//
//  telCell.m
//  Recycling
//
//  Created by jzd on 2018/5/22.
//  Copyright © 2018年 宋佳. All rights reserved.
//

#import "telCell.h"

@implementation telCell

- (void)awakeFromNib {
    [super awakeFromNib];
}
- (IBAction)telOnClick:(UIButton *)sender {
    NSString *resourceSpecifier = self.telButton.currentAttributedTitle.string;
    NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@",resourceSpecifier];
    if (@available(iOS 10.0, *)) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone] options:@{} completionHandler:nil];
    } else {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
    }
//    NSString *resourceSpecifier = self.telButton.currentAttributedTitle.string;
//    NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@", resourceSpecifier];
//    /// 防止iOS 10及其之后，拨打电话系统弹出框延迟出现
//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
//        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
//    });
}

@end
